<?php
global $references;
$references = array(

    "basicNamespace" => array(
        "class" => "Pageley_Domain_BasicNamespace",
        "constructor" => array(
            "uri" => "urn:basic.pageley.org:1.0-SNAPSHOT",
            "alias" => "basic"
        )
    ),

	"attribute.boolean" => array(
		"class" => "Pageley_Domain_Attribute_Boolean",
		"constructor" => array(
			"name" => "boolean"
		)
	),

	"attribute.code" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "code",
			"validators" => array(
				"#{validator.length16}",
			)
		)
	),

	"attribute.password" => array(
		"class" => "Pageley_Domain_Attribute_Password",
		"constructor" => array(
			"name" => "password",
			"validators" => array(
				"#{validator.length32}",
			)
		)
	),

	"attribute.name" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "name",
			"validators" => array(
				"#{validator.length64}",
			)
		)
	),

    "attribute.shortText" => array(
        "class" => "Pageley_Domain_Attribute_Basic",
        "constructor" => array(
            "name" => "shortText",
            "validators" => array(
                "#{validator.length128}"
            )
        )
    ),

	"attribute.text" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "text",
			"validators" => array(
				"#{validator.length256}"
			)
		)
	),

	"attribute.longText" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "longText"
		)
	),

    "attribute.richText" => array(
        "class" => "Pageley_Domain_Attribute_Basic",
        "constructor" => array(
            "name" => "richText"
        )
    ),

	"attribute.data" => array(
		"class" => "Pageley_Domain_Attribute_Data",
		"constructor" => array(
			"name" => "data"
		)
	),

	"attribute.number" => array(
		"class" => "Pageley_Domain_Attribute_Number",
		"constructor" => array(
			"name" => "number"
		)
	),

    "attribute.positiveInteger" => array(
        "class" => "Pageley_Domain_Attribute_Number",
        "constructor" => array(
            "name" => "positiveInteger",
            "validators" => array(
                "#{validator.positiveInteger}"
            )
        )
    ),

	"attribute.timestamp" => array(
		"class" => "Pageley_Domain_Attribute_Timestamp",
		"constructor" => array(
			"name" => "timestamp"
		)
	),

    "attribute.date" => array(
        "class" => "Pageley_Domain_Attribute_Timestamp",
        "constructor" => array(
            "name" => "date"
        )
    ),

	"attribute.currency" => array(
		"class" => "Pageley_Domain_Attribute_Enumeration",
		"constructor" => array(
			"name" => "currency",
			"className" => "Pageley_Basic_Domain_Currency"
		)
	),

	"attribute.money" => array(
		"class" => "Pageley_Domain_Attribute_Composite",
		"constructor" => array(
			"name" => "money",
	        "className" => "Pageley_Basic_Domain_Money",
			"attributes" => array(
				"currency" => "#{attribute.required(attribute.currency)}",
				"value" => "#{attribute.required(attribute.number)}"
			)
		)
	),

	"attribute.address" => array(
		"class" => "Pageley_Domain_Attribute_Composite",
		"constructor" => array(
			"name" => "address",
	        "className" => "Pageley_Basic_Domain_Address",
			"attributes" => array(
				"line1" => "#{attribute.required(attribute.shortText)}",
				"line2" => "#{attribute.shortText}",
				"city" => "#{attribute.required(attribute.name)}",
				"postalCode" => "#{attribute.required(attribute.code)}"
			)
		)
	),

	"attribute.emailAddress" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "emailAddress",
			"validators" => array(
				"#{validator.length256}",
				"#{validator.emailAddress}"
			)
		)
	),

	"attribute.url" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "url",
			"validators" => array(
				"#{validator.length256}",
				"#{validator.url}"
			)
		)
	),

	"attribute.phoneNumber" => array(
		"class" => "Pageley_Domain_Attribute_Basic",
		"constructor" => array(
			"name" => "phoneNumber",
			"validators" => array(
				"#{validator.length32}",
				"#{validator.phoneNumber}"
			)
		)
	),

    "attribute.imageFile" => array(
        "class" => "Pageley_Domain_Attribute_File",
        "constructor" => array(
            "name" => "imageFile",
            "fileManager" => "#{fileManager}",
            "validators" => array(
                "#{validator.image}"
            )
        )
    ),

    "attribute.tag" => array(
        "class" => "Pageley_Domain_Attribute_Reference",
        "constructor" => array(
            "name" => "tag"
        ),
        "properties" => array(
            "type" => "#{type.basic.Tag}"
        )
    ),

	"attribute.image" => array(
		"class" => "Pageley_Domain_Attribute_Reference",
        "constructor" => array(
            "name" => "image"
        ),
        "properties" => array(
            "type" => "#{type.basic.Image}"
        )
	),

    "attribute.slideshow" => array(
        "class" => "Pageley_Domain_Attribute_Reference",
        "constructor" => array(
            "name" => "slideshow"
        ),
        "properties" => array(
            "type" => "#{type.basic.Slideshow}"
        )
    ),

    "attribute.required" => array(
		"class" => "Pageley_Domain_Attribute_RequiredDecorator",
	    "singleton" => "false"
	),
	
	"attribute.unique" => array(
        "class" => "Pageley_Domain_Attribute_UniqueDecorator",
        "singleton" => "false",
	    "constructor" => array(
	        "gateway" => "#{gateway}"
	    )
    ),

    "attribute.oneToMany" => array(
		"class" => "Pageley_Domain_Attribute_OneToManyDecorator",
	    "singleton" => "false"
	),

    "attribute.manyToMany" => array(
		"class" => "Pageley_Domain_Attribute_ManyToManyDecorator",
	    "singleton" => "false"
	),

	"attribute.largeObject" => array(
		"class" => "Pageley_Domain_Attribute_Reference",
		"constructor" => array(
			"name" => "data"
		),
		"properties" => array(
            "type" => "#{type.system.LargeObject}"
		)
	),
);